#include<func.h>
int main(void)
{
    char buf[4096];
    //父子进程通信
    int fds[2];
    socketpair(AF_UNIX,SOCK_STREAM,0,fds);
    if(fork())
    {
        close(fds[0]);
        ssize_t sret = send(fds[1],"helloworld",10,0);
        printf("%d\n",sret);
    }
    else
    {
        close(fds[1]);
        bzero(buf,sizeof(buf));
        recv(fds[0],buf,sizeof(buf),0);
        printf("buf = %s\n",buf);
    }
    return 0;
}